#ifndef NMC_TILE_HPP
#define NMC_TILE_HPP

#include "point.hpp"
#include "rectangle.hpp"

namespace nmc
{
	class Actor;
	class Graphics;
	class TileMap;

	class Tile
	{
	public:
		Tile();
		static const int SIZE = 16;

		virtual void stickToFloor(Actor* actor, Point& velocity) = 0;
		virtual void resolveCollision(Actor* actor, Point& velocity) = 0;
		virtual bool isStandingOnFloor(Actor* actor) = 0;
		virtual void calculateSolidity(TileMap* tileMap) = 0;
		virtual void draw(Graphics* graphics) = 0;
		virtual void drawType(Graphics* graphics) = 0;
		virtual void drawSolidity(Graphics* graphics);
		void setCollisionChecked(bool checked);

		enum Type
		{
			EMPTY,
			SOLID,
			SLOPING_LEFT,
			SLOPING_RIGHT
		};

		enum Layer
		{
			BACKGROUND = 0,
			FOREGROUND
		};

		Type getType() const;
		Layer getLayer() const;
		void setLayer(Layer layer);
		const Point& getTileMapPosition() const;
		const Point getWorldPosition() const;
		const int getWidth() const { return SIZE; }
		const int getHeight() const { return SIZE; }
		TileMap* getTileMap();

	protected:
		Tile(Type type, const Point& tileMapPosition, TileMap* tileMap);
		Point mTileMapPosition;
		Layer mLayer;
		bool mCollisionChecked;

	private:
		Type mType;
		TileMap* mTileMap;
	
	};
}
#endif